package com.xinsoft.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinsoft.entity.dto.ScmPurchasePageParam;
import com.xinsoft.entity.po.FmsAccountsPay;
import com.xinsoft.entity.po.ScmPurchase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinsoft.entity.vo.ScmPurchasePageVo;
import com.xinsoft.entity.vo.ScmPurchasePriceVo;
import com.xinsoft.entity.vo.ScmPurchaseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 13370
* @description 针对表【scm_purchase(采购订单)】的数据库操作Mapper
* @createDate 2023-07-04 14:35:53
* @Entity com.xinsoft.entity.po.ScmPurchase
*/
public interface ScmPurchaseMapper extends BaseMapper<ScmPurchase> {

    ScmPurchaseVo getScmPurchase(@Param("id") Integer id);

    /**
     * 最近三次历史价格
     *
     * @param clientId   客户id
     * @param materialId 物料id
     * @return {@link ScmPurchasePriceVo}
     */
    ScmPurchasePriceVo historyPrice(@Param("clientId")Integer clientId, @Param("materialId")Integer materialId);

    IPage<ScmPurchasePageVo> findListByParam(Page<ScmPurchasePageVo> page,@Param("param") ScmPurchasePageParam scmPurchasePageParam);

    List<ScmPurchasePageVo> findListByParam(@Param("param") ScmPurchasePageParam scmPurchasePageParam);

    List<FmsAccountsPay> getScmPayById(Integer id);
}




